feat(cli): add aignostics-sdk slim CLI entry point [PYSDK-137]#658
Open
ari-nz wants to merge 1 commit into
Open
feat(cli): add aignostics-sdk slim CLI entry point [PYSDK-137]#658ari-nz wants to merge 1 commit into
ari-nz wants to merge 1 commit into
Conversation
Creates packages/aignostics-sdk/src/aignostics_sdk/cli.py with a trimmed Typer app exposing only the platform CLI commands (user, sdk). Deliberately avoids calling prepare_cli() to prevent auto-discovery of heavy domain modules (application, wsi, dataset, bucket, qupath, system) via locate_implementations(typer.Typer). Instead, applies epilog and no-args-is-help behaviour directly by calling the private helpers _add_epilog_recursively and _no_args_is_help_recursively.
There was a problem hiding this comment.
Pull request overview
Adds a dedicated CLI entry point for the aignostics-sdk slim distribution, intentionally avoiding the prepare_cli() auto-discovery that would deep-scan the aignostics package and pull in heavy domain modules.
Changes:
- Introduces
aignostics_sdk/cli.pyas the slim CLI entry point. - Registers only
platform-level subcommands (user,sdk) on the root Typer app. - Applies existing CLI UX helpers (epilog + “no args shows help”) without running module auto-discovery.
Comment on lines
+14
to
+15
| from aignostics_sdk.platform import cli_sdk, cli_user | ||
| from aignostics_sdk.utils import __python_version__, __version__ |
|
|
||
| from aignostics_sdk.platform import cli_sdk, cli_user | ||
| from aignostics_sdk.utils import __python_version__, __version__ | ||
| from aignostics_sdk.utils._cli import _add_epilog_recursively, _no_args_is_help_recursively |
Comment on lines
+20
to
+22
| cli = typer.Typer( | ||
| help="Command Line Interface (CLI) of Aignostics SDK providing access to Aignostics Platform.", | ||
| ) |
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Train — PYSDK-133
Summary
packages/aignostics-sdk/src/aignostics_sdk/cli.py— the entry point for theaignostics-sdkslim distribution CLI (wired viaaignostics-sdk = "aignostics_sdk.cli:cli"inpyproject.toml)user(login, logout, whoami) andsdk(run-metadata-schema, item-metadata-schema)prepare_cli()auto-discovery to prevent the heavy domain modules (application, wsi, dataset, bucket, qupath, system) from being pulled in vialocate_implementations(typer.Typer)which deep-scans theaignosticspackageaignostics-sdk --helpoutputIncluded commands:
user login,user logout,user whoami,sdk run-metadata-schema,sdk item-metadata-schemaExcluded commands:
application,wsi,dataset,bucket,qupath,notebook,gui,system,launchpad,mcpWhy not
prepare_cli()?prepare_cli()callslocate_implementations(typer.Typer)which deep-scans the package named__project_name__(hardcoded as"aignostics"). In the monorepo workspace — and in any installation where the fullaignosticspackage is present — this would silently add all heavy domain CLIs, defeating the purpose of the slim distribution. The fix is to apply only the UX helpers (_add_epilog_recursively,_no_args_is_help_recursively) directly, without the auto-discovery step.Test plan
uv run --package aignostics-sdk aignostics-sdk --helpshows onlyuserandsdkcommandsuv run --package aignostics-sdk aignostics-sdk user --helpshows login/logout/whoamiuv run --package aignostics-sdk aignostics-sdk sdk --helpshows metadata-schema commandsmake lintpasses (ruff + pyright + mypy)application,wsi,dataset,bucket,qupath,notebook,gui,system,launchpad) appear in help output